import request from '@/utils/request'

export function getComplaints(data) {
  return request({
    url: '/complaint/complaint/getAll',
    method: 'get',
    params: data
  })
}

export function getComplaints2(data) {
  return request({
    url: '/complaint/complaint/getAll2',
    method: 'get',
    params: data
  })
}

export function ignoreComplaint(id) {
  return request({
    url: '/complaint/complaint/ignoreComplaint/' + id,
    method: 'delete',
  })
}

export function changeStatus(status, name, id) {
  return request({
    url: '/complaint/complaint/changeStatus/' + status + '/' + name + '/' + id,
    method: 'put',
  })
}

export function rollbackComplaint(id) {
  return request({
    url: '/complaint/complaint/rollbackComplaint/' + id,
    method: 'put',
  })
}

export function changeStatus2(name, id) {
  return request({
    url: '/complaint/complaint/changeStatus2/' + name + '/' + id,
    method: 'put',
  })
}

export function getStatics(id) {
  return request({
    url: '/complaint/complaint/getStatics/' + id,
    method: 'get',
  })
}

//下面是代码生成器生成的
// 查询【请填写功能名称】列表
export function listComplaint(query) {
  return request({
    url: '/complaint/complaint/list',
    method: 'get',
    params: query
  })
}

// 查询【请填写功能名称】详细
export function getComplaint(id) {
  return request({
    url: '/complaint/complaint/' + id,
    method: 'get'
  })
}

// 新增【请填写功能名称】
export function addComplaint(data) {
  return request({
    url: '/complaint/complaint',
    method: 'post',
    data: data
  })
}

// 修改【请填写功能名称】
export function updateComplaint(data) {
  return request({
    url: '/complaint/complaint',
    method: 'put',
    data: data
  })
}

// 删除【请填写功能名称】
export function delComplaint(id) {
  return request({
    url: '/complaint/complaint/' + id,
    method: 'delete'
  })
}

